Optimal. Leaf size=136 \[ -\frac {\tan ^{-1}\left (\frac {1-2 x}{\sqrt {3}}\right ) (d+f-2 h)}{2 \sqrt {3}}+\frac {\tan ^{-1}\left (\frac {2 x+1}{\sqrt {3}}\right ) (d+f-2 h)}{2 \sqrt {3}}-\frac {1}{4} (d-f) \log \left (x^2-x+1\right )+\frac {1}{4} (d-f) \log \left (x^2+x+1\right )+\frac {(2 e-g) \tan ^{-1}\left (\frac {2 x^2+1}{\sqrt {3}}\right )}{2 \sqrt {3}}+\frac {1}{4} g \log \left (x^4+x^2+1\right )+h x \]
________________________________________________________________________________________
Rubi [A] time = 0.14, antiderivative size = 136, normalized size of antiderivative = 1.00, number of steps used = 17, number of rules used = 8, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.258, Rules used = {1673, 1676, 1169, 634, 618, 204, 628, 1247} \begin {gather*} -\frac {\tan ^{-1}\left (\frac {1-2 x}{\sqrt {3}}\right ) (d+f-2 h)}{2 \sqrt {3}}+\frac {\tan ^{-1}\left (\frac {2 x+1}{\sqrt {3}}\right ) (d+f-2 h)}{2 \sqrt {3}}-\frac {1}{4} (d-f) \log \left (x^2-x+1\right )+\frac {1}{4} (d-f) \log \left (x^2+x+1\right )+\frac {(2 e-g) \tan ^{-1}\left (\frac {2 x^2+1}{\sqrt {3}}\right )}{2 \sqrt {3}}+\frac {1}{4} g \log \left (x^4+x^2+1\right )+h x \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 204
Rule 618
Rule 628
Rule 634
Rule 1169
Rule 1247
Rule 1673
Rule 1676
Rubi steps
\begin {align*} \int \frac {d+e x+f x^2+g x^3+h x^4}{1+x^2+x^4} \, dx &=\int \frac {x \left (e+g x^2\right )}{1+x^2+x^4} \, dx+\int \frac {d+f x^2+h x^4}{1+x^2+x^4} \, dx\\ &=\frac {1}{2} \operatorname {Subst}\left (\int \frac {e+g x}{1+x+x^2} \, dx,x,x^2\right )+\int \left (h+\frac {d-h+(f-h) x^2}{1+x^2+x^4}\right ) \, dx\\ &=h x+\frac {1}{4} (2 e-g) \operatorname {Subst}\left (\int \frac {1}{1+x+x^2} \, dx,x,x^2\right )+\frac {1}{4} g \operatorname {Subst}\left (\int \frac {1+2 x}{1+x+x^2} \, dx,x,x^2\right )+\int \frac {d-h+(f-h) x^2}{1+x^2+x^4} \, dx\\ &=h x+\frac {1}{4} g \log \left (1+x^2+x^4\right )+\frac {1}{2} \int \frac {d-h-(d-f) x}{1-x+x^2} \, dx+\frac {1}{2} \int \frac {d-h+(d-f) x}{1+x+x^2} \, dx+\frac {1}{2} (-2 e+g) \operatorname {Subst}\left (\int \frac {1}{-3-x^2} \, dx,x,1+2 x^2\right )\\ &=h x+\frac {(2 e-g) \tan ^{-1}\left (\frac {1+2 x^2}{\sqrt {3}}\right )}{2 \sqrt {3}}+\frac {1}{4} g \log \left (1+x^2+x^4\right )+\frac {1}{4} (d-f) \int \frac {1+2 x}{1+x+x^2} \, dx+\frac {1}{4} (-d+f) \int \frac {-1+2 x}{1-x+x^2} \, dx+\frac {1}{4} (d+f-2 h) \int \frac {1}{1-x+x^2} \, dx+\frac {1}{4} (d+f-2 h) \int \frac {1}{1+x+x^2} \, dx\\ &=h x+\frac {(2 e-g) \tan ^{-1}\left (\frac {1+2 x^2}{\sqrt {3}}\right )}{2 \sqrt {3}}-\frac {1}{4} (d-f) \log \left (1-x+x^2\right )+\frac {1}{4} (d-f) \log \left (1+x+x^2\right )+\frac {1}{4} g \log \left (1+x^2+x^4\right )+\frac {1}{2} (-d-f+2 h) \operatorname {Subst}\left (\int \frac {1}{-3-x^2} \, dx,x,-1+2 x\right )+\frac {1}{2} (-d-f+2 h) \operatorname {Subst}\left (\int \frac {1}{-3-x^2} \, dx,x,1+2 x\right )\\ &=h x-\frac {(d+f-2 h) \tan ^{-1}\left (\frac {1-2 x}{\sqrt {3}}\right )}{2 \sqrt {3}}+\frac {(d+f-2 h) \tan ^{-1}\left (\frac {1+2 x}{\sqrt {3}}\right )}{2 \sqrt {3}}+\frac {(2 e-g) \tan ^{-1}\left (\frac {1+2 x^2}{\sqrt {3}}\right )}{2 \sqrt {3}}-\frac {1}{4} (d-f) \log \left (1-x+x^2\right )+\frac {1}{4} (d-f) \log \left (1+x+x^2\right )+\frac {1}{4} g \log \left (1+x^2+x^4\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 0.60, size = 165, normalized size = 1.21 \begin {gather*} \frac {1}{24} \left (4 \tan ^{-1}\left (\frac {1}{2} \left (\sqrt {3}-i\right ) x\right ) \left (\left (\sqrt {3}+3 i\right ) d+\left (\sqrt {3}-3 i\right ) f-2 \sqrt {3} h\right )+4 \tan ^{-1}\left (\frac {1}{2} \left (\sqrt {3}+i\right ) x\right ) \left (\left (\sqrt {3}-3 i\right ) d+\left (\sqrt {3}+3 i\right ) f-2 \sqrt {3} h\right )-8 \sqrt {3} e \tan ^{-1}\left (\frac {\sqrt {3}}{2 x^2+1}\right )+4 \sqrt {3} g \tan ^{-1}\left (\frac {\sqrt {3}}{2 x^2+1}\right )+6 g \log \left (x^4+x^2+1\right )+24 h x\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [F] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {d+e x+f x^2+g x^3+h x^4}{1+x^2+x^4} \, dx \end {gather*}
Verification is not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 4.52, size = 92, normalized size = 0.68 \begin {gather*} \frac {1}{6} \, \sqrt {3} {\left (d - 2 \, e + f + g - 2 \, h\right )} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x + 1\right )}\right ) + \frac {1}{6} \, \sqrt {3} {\left (d + 2 \, e + f - g - 2 \, h\right )} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x - 1\right )}\right ) + h x + \frac {1}{4} \, {\left (d - f + g\right )} \log \left (x^{2} + x + 1\right ) - \frac {1}{4} \, {\left (d - f - g\right )} \log \left (x^{2} - x + 1\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.30, size = 94, normalized size = 0.69 \begin {gather*} \frac {1}{6} \, \sqrt {3} {\left (d + f + g - 2 \, h - 2 \, e\right )} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x + 1\right )}\right ) + \frac {1}{6} \, \sqrt {3} {\left (d + f - g - 2 \, h + 2 \, e\right )} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x - 1\right )}\right ) + h x + \frac {1}{4} \, {\left (d - f + g\right )} \log \left (x^{2} + x + 1\right ) - \frac {1}{4} \, {\left (d - f - g\right )} \log \left (x^{2} - x + 1\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.01, size = 241, normalized size = 1.77 \begin {gather*} \frac {\sqrt {3}\, d \arctan \left (\frac {\left (2 x +1\right ) \sqrt {3}}{3}\right )}{6}+\frac {\sqrt {3}\, d \arctan \left (\frac {\left (2 x -1\right ) \sqrt {3}}{3}\right )}{6}-\frac {d \ln \left (x^{2}-x +1\right )}{4}+\frac {d \ln \left (x^{2}+x +1\right )}{4}-\frac {\sqrt {3}\, e \arctan \left (\frac {\left (2 x +1\right ) \sqrt {3}}{3}\right )}{3}+\frac {\sqrt {3}\, e \arctan \left (\frac {\left (2 x -1\right ) \sqrt {3}}{3}\right )}{3}+\frac {\sqrt {3}\, f \arctan \left (\frac {\left (2 x +1\right ) \sqrt {3}}{3}\right )}{6}+\frac {\sqrt {3}\, f \arctan \left (\frac {\left (2 x -1\right ) \sqrt {3}}{3}\right )}{6}+\frac {f \ln \left (x^{2}-x +1\right )}{4}-\frac {f \ln \left (x^{2}+x +1\right )}{4}+\frac {\sqrt {3}\, g \arctan \left (\frac {\left (2 x +1\right ) \sqrt {3}}{3}\right )}{6}-\frac {\sqrt {3}\, g \arctan \left (\frac {\left (2 x -1\right ) \sqrt {3}}{3}\right )}{6}+\frac {g \ln \left (x^{2}-x +1\right )}{4}+\frac {g \ln \left (x^{2}+x +1\right )}{4}+h x -\frac {\sqrt {3}\, h \arctan \left (\frac {\left (2 x +1\right ) \sqrt {3}}{3}\right )}{3}-\frac {\sqrt {3}\, h \arctan \left (\frac {\left (2 x -1\right ) \sqrt {3}}{3}\right )}{3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 2.62, size = 92, normalized size = 0.68 \begin {gather*} \frac {1}{6} \, \sqrt {3} {\left (d - 2 \, e + f + g - 2 \, h\right )} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x + 1\right )}\right ) + \frac {1}{6} \, \sqrt {3} {\left (d + 2 \, e + f - g - 2 \, h\right )} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x - 1\right )}\right ) + h x + \frac {1}{4} \, {\left (d - f + g\right )} \log \left (x^{2} + x + 1\right ) - \frac {1}{4} \, {\left (d - f - g\right )} \log \left (x^{2} - x + 1\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 6.11, size = 1209, normalized size = 8.89
result too large to display
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________